import React from 'react';
import { Text } from 'react-native';
import PropTypes from 'prop-types';
import fn from '../../components/PlateformHalf';

const Label = ({ bold, children }) => (
  <Text
    style={{
      color: '#333',
      fontWeight: bold ? 'bold' : 'normal',
      fontSize: fn(16),
      lineHeight: fn(24),
    }}
  >
    {children}
  </Text>
);
Label.defaultProps = {
  bold: false,
  children: null,
};
Label.propTypes = {
  /**
   * ### Label 属性说明
   *
   * 默认展示文字
   *
   * | Name | Type | Default | Details | isRequired |
   * | ------:| -----------:| -----------: | -----------: | ------:|
   * | bold | bool | | 文字是否加粗 | no |
   * | children | string | | 传入的文字 | no |
   *
   * ### Label 代码示例(详见示例项目)
   *
   * ```html
   * <Label bold={true}>默认展示文字</Label>
   * ```
   */
  bold: PropTypes.bool,
  children: PropTypes.string,
};
export default Label;
